import requests
import config


class EmpIdUtil:
    # 获取员工id
    @classmethod
    def get_emp_id(cls,token):
        url = "http://ihrm-test.itheima.net/api/sys/user"
        header = {"Content-Type": "application/json","Authorization":token}
        data = {"username": "陈香香", "mobile": config.TEL, "workNumber": "1001"}
        resp_add = requests.post(url=url, headers=header, json=data)
        emp_id = resp_add.json().get("data").get("id")
        return emp_id

# if __name__ == '__main__':
#     x = EmpIdUtil()
#     x.get_emp_id()
